package org.fanrui.hrm.feign.clients;

import org.fanrui.hrm.constants.server.MicroserviceName;
import org.fanrui.hrm.domain.Login;
import org.fanrui.hrm.dto.LoginMealDto;
import org.fanrui.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


/**
 * 用来调用认证服务中心的登录服务
 *
 * @author fanrui
 */
@FeignClient(value = MicroserviceName.AUTH_SERVER, fallbackFactory = LoginFeignClientFallbackFactory.class)
@RequestMapping("/login")
public interface LoginFeignClients {
    /**
     * 保存一个login
     *
     * @param login 登录信息
     * @return AjaxResult
     */
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    AjaxResult save(@RequestBody Login login);

    /**
     * 保存一个login和套餐id
     *
     * @return AjaxResult
     */
    @RequestMapping(value = "/saveLoginAndMealId", method = RequestMethod.POST)
    AjaxResult saveLoginAndMealId(@RequestBody LoginMealDto loginMealDto);
}
